package com.cloudbroker.bcs.platform.dav.common.config;

import com.cloudbroker.bcs.common.configure.ConfigUtil;
import com.cloudbroker.bcs.common.configure.TenantConfig;
import com.cloudbroker.bcs.common.context.DataContext;
import com.cloudbroker.bcs.common.util.StringUtil;
import com.cloudbroker.bcs.common.util.ValueUtil;

public class ConfigValues {
    
    /**
     * 默认每页请求行数
     */
    public static final int REQUEST_NUM = 10;

    /**
     * 默认会话超时时间（秒）
     */
    public static final int SESSION_TIMEOUT = 10 * 60;
    
    /**
     * 租户ID宽度
     */
    public static final int TENANT_ID_WIDTH = 4;
    
    /**
     * 默认ID序列号宽度
     */
    public static final int ID_SEQ_WIDTH = 10;
    
    /**
     * 默认ID序列号尝试获得次数（由于并发而失败）
     */
    public static final int ID_SEQ_GEN_TRIES = 3;
    
    /**
     * 默认密码长度
     */
    public static final int DEFAULT_PWD_LENGTH = 6;
    
    /**
     * 验证码重试次数
     */
    public static final int VERIFY_CODE_RETRY_TIMES = 5;
    
    /**
     * 验证码长度
     */
    public static final int VERIFY_CODE_LENGTH = 6;
    
    /**
     * 邀请码长度
     */
    public static final int INVITATION_CODE_LENGTH = 6;
    
    /**
     * 验证码超时时间（秒）
     */
    public static final int VERIFY_CODE_TIMEOUT = 2 * 60;
    
    /**
     * 密码盐值长度
     */
    public static final int PWD_SALT_LENGTH = 32;
    
    /**
     * 付费观点默认显示字数
     */
    public static final int PAYREAD_VIEWPOINT_SHOW = 40;
    
    /**
     * 显示在线用户数开关
     */
    public static final int ONLINE_NUM_SHOW_FLAG = 1;
    /**
     * 显示在线用户数阈值
     */
    public static final int ONLINE_NUM_SHOW_THRESHOLD = 100;
    
    public static final String YUNXIN_APP_KEY = "11869807ac7ba398891434c33e8e9e3a";
    public static final String YUNXIN_APP_SECRET = "8b2384420fa5";
    public static final String YUNXIN_NONCE = "12345";
    
    /**
     * 自定义标签数量
     */
    public static final int DEFINE_TAG_NUM = 5;
    
    public static final String[] DEFAULT_VIEWPOINT_TAG = { "行情资讯" };
    
    /**
     * 微信配置信息
     */
    public static final String WEIXIN_APP_KEY = "wx8195d3c704382ec8";
    public static final String WEIXIN_APP_SECRET = "37283ecc930f499f2d9d848218b60d13";
    public static final String MCH_ID = "1322680501";
    public static final String NOTIFY_URL = "http://120.27.166.214/func_pay_callback";
    
    /**
     * 微博配置信息
     */
    public static final String WEIBO_APP_KEY = "1442812672";
    public static final String WEIBO_APP_SECRET = "4111d10d716bc1d0a773d90299c1fbf8";
    public static final String WEIBO_REDIRECT_URI = "http://fensiuat.yjifs.com/webroot/greatV/?oauth_provider=SinaProvider";
    
    /**
     * QQ配置信息
     */
    public static final String QQ_APP_KEY = "1105436568";
    public static final String QQ_APP_SECRET = "xvSGiXqj7yRjwb5o";
    public static final String QQ_REDIRECT_URI = "http%3a%2f%2ffensiuat.yjifs.com%2fwebroot%2fgreatV%2f%3foauth_provider%3dSinaProvider";

    /**
     * 云纪组织机构配置信息
     */
    public static final String YUNJI_BRANCH_NO = "100";

    /**
     * 用户中心加密key
     */
    public static final String USER_CENTER_KEY = "d010f0d8ea0148a0925149ea9e539513";

    /**
     * 发送短信配置信息
     */
    public static final String SMS_COMPANY_ID = "91000";

    public static final String SMS_BUSINSYS_NO = "1002";

    public static final String SMS_AUTHKEY_TEXT = "d81bba1e3ab340fc8c0977fd6d12affc";

    public static final String SMS_SVC_URL = "http://10.253.5.148:8082/iuchttpservice/services/send_sms";

    public static final String SMS_OWN_COMPANY_ID = "91000";

    public static final String SMS_IMPL = "SMSServiceHSIUCT2Impl";

    //敏感字符集合
    public static final String SENSITIVE_WORD = "";

    public static String getSensitiveWord(Integer tenantId){
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + tenantId);
        if (tenantConfig == null) {
            return SENSITIVE_WORD;
        }
        return tenantConfig.get("sensitive.word",SENSITIVE_WORD);
    }

    public static String getSMSImplByTenant(Integer tenantId){
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + tenantId);
        if (tenantConfig == null) {
            return getSMSImpl();
        }
        return tenantConfig.get("sms.impl.tenant",getSMSImpl());
    }

    public static String getSMSCompanyIdByTenant(Integer tenantId){
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + tenantId);
        if (tenantConfig == null) {
            return getSmsCompanyId();
        }
        return tenantConfig.get("sms.company.id.tenant",getSmsCompanyId());
    }

    public static String getSMSAuthKeyByTenant(Integer tenantId){
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + tenantId);
        if (tenantConfig == null) {
            return getSmsAuthKey();
        }
        return tenantConfig.get("sms.authkey.tenant",getSmsAuthKey());
    }

    public static String getSMSBusinsysNoByTenant(Integer tenantId){
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + tenantId);
        if (tenantConfig == null) {
            return getSmsBusinsysNo();
        }
        return tenantConfig.get("sms.businsys.no.tenant",getSmsBusinsysNo());
    }

    public static String getSMSOwnCompanyIdByTenant(Integer tenantId){
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + tenantId);
        if (tenantConfig == null) {
            return getSmsOwnCompanyId();
        }
        return tenantConfig.get("sms.own.company.id.tenant",getSmsOwnCompanyId());
    }

    public static String getSMSSvcUrlByTenant(Integer tenantId){
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + tenantId);
        if (tenantConfig == null) {
            return getSMSSvcUrl();
        }
        return tenantConfig.get("sms.svc.url.tenant",getSMSSvcUrl());
    }

    /**
     * 获取微信ticket配置
     */
    public static final String WX_TICKET_IMPLTYPE = "common";

    public static String getWxTicketImpltype(Integer tenantId){
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + tenantId);
        return tenantConfig.get("wx.ticket.implType",WX_TICKET_IMPLTYPE);
    }

    /**
     * OPENAPI配置信息
     */
    public static final String OPEN_API_AUTH_UTL = "http://10.156.245.16/oauth2/oauth2/token";
    public static final String OPEN_API_APP_KEY = "e1ae550b-64e7-457d-b49a-41fe340c75e4";
    public static final String OPEN_API_APP_SECRET = "afbde69d-b4fa-4e14-82d4-fd0c6387ae05";
    public static final String OPEN_API_REDIRECT_URI = "192.168.222.93";
    
    /**
     * 富文本配置
     */
    public static final String XSS_AVOID_TAG = "script,head,frame,frameset";
    public static final String XSS_ALLOW_TAG = "a,hr,h1,h2,h3,h4,h5,h6,font,em,img,map,embed,marquee,bgsound,blockquote,audio,video";
    public static final String XSS_AVOID_VALUE = "alert,onclick,onload,onerror,onmousemove,onmouseout,onmouseover,onmouseup,onmouseenter,onmouseleave,onmousewheel,onscroll";
    
    public static final Integer COMPRESS_SIZE = 200;
    public static final Double COMPRESS_RATIO = 0.8;


    /**
     *light公共平台配置信息
     */
    public static final String USER_SOURCE = "10";
    public static final String OAUTHPROV_CODE = "5503";
    public static final String APP_AUTH_URL = "http://192.168.58.211:80/oauth.controller/oauth/auth/authLogin.json";
    public static final String APP_KEY = "400d08fe-045d-42fc-8a6f-c6aa217c2abc";
    public static final String APP_SECRET = "c1b00de0-32ac-40bb-9e70-02fe08bc608b";

    /*
     *用户行为分析系统配置
     */
    public static final String USER_BEHAVIOR_APP_KEY = "a99fcd6358c44ed984844caed31282ff";

    /*
    *MD5加密key
    */
    public static final String MD5_KEY = "d7015b6d7ee411e69907ecf4bbdef9f4";

    /*
    *粉丝实盘猜涨跌appKey
    */
    public static final String POINT_APP_KEY = "d7015b6d7ee411e69907ecf4bbdef9f4";

    /*
    *粉丝实盘猜涨跌app密码
    */
    public static final String POINT_APP_SECRET = "d7015b6d7ee411e69907ecf4bbdef9f4";

    /*
    *粉丝实盘猜涨跌链接地址
    */
    public static final String POINT_URL = "http://www.baidu.com";

    /**
     * 获取itn资讯的配置
     */
    public static final String ITN_ACCESS_TOKEN_KEY = "626ba1bb-210a-49da-9fde-3ac0b3dc772b";
    public static final String ITN_ACCESS_TOKEN_SECRET = "1a7a3ae3-301b-445a-a0d5-563dc535bc7d";
    public static final String ITN_ACCESS_TOKEN_URL = "https://open.hscloud.cn/oauth2/oauth2/token";

    public static String getItnAccessTokenKey()
    {
        return ConfigUtil.get("itn.access.token.key",ITN_ACCESS_TOKEN_KEY);
    }
    public static String getItnAccessTokenSecret(){
        return ConfigUtil.get("itn.access.token.secret",ITN_ACCESS_TOKEN_SECRET);
    }
    public static String getItnAccessTokenUrl(){
        return ConfigUtil.get("itn.access.token.url",ITN_ACCESS_TOKEN_URL);
    }

    /**
     * 金币昵称
     */
    public static final String COINS_NAME = "金币";

    /**
     * 用户来源 需要向公共平台申请
     **/
    public static String getUserSource() {
        return ConfigUtil.get("light.user.source",USER_SOURCE);}

    /**
     * 机构编码 需要向公共平台申请
     **/
    public static String getOAUTHPROVCODE() {  return ConfigUtil.get("light.oauthprov.code",OAUTHPROV_CODE);}
    /**
     * 授权地址
     **/
    public static String getAppAuthUrl() {return ConfigUtil.get("light.app.url",APP_AUTH_URL);}
    /**
     * app_key
     **/
    public static String getAppKey() {return ConfigUtil.get("light.app.key",APP_KEY);}
    /**
     * app_secret
     **/
    public static String getAppSecret() {return ConfigUtil.get("light.app.secret",APP_SECRET);}

    /**
     * 获取会话超时时间（秒）
     * 
     * @return
     */
    public static int getSessionTimeout() {
        return ConfigUtil.get("func.session.timeout", SESSION_TIMEOUT);
    }
    
    /**
     * 邀请码长度
     * 
     * @return
     */
    public static int getInviteCodeLength() {
        return ConfigUtil.get("func_Invitecode_length", INVITATION_CODE_LENGTH);
    }
    
    /**
     * 邀请码数据字段
     * 
     * @return
     */
    public static String getInviteCodeDit() {
        return ConfigUtil.get("func_Invitecode_dict");
    }
    
    /**
     * 验证码长度
     * 
     * @return
     */
    public static int getVerifyCodeLength() {
        return ConfigUtil.get("func.verifycode.length", VERIFY_CODE_LENGTH);
    }
    
    /**
     * 验证码重试次数
     * 
     * @return
     */
    public static int getVerifyCodeRetryTimes() {
        return ConfigUtil.get("func.verifycode.retry.times", VERIFY_CODE_RETRY_TIMES);
    }
    
    /**
     * 验证码超时时间（秒）
     * 
     * @return
     */
    public static int getVerifyCodeTimeout() {
        return ConfigUtil.get("func.verifycode.timeout", VERIFY_CODE_TIMEOUT);
    }
    
    /**
     * 中台REST服务基路径（内网/局域网）
     * 
     * @return
     */
    public static String getAPIRestUrlBaseLan() {
        return ConfigUtil.get("hsbcps.api.rest.urlBase.lan");
    }
    
    /**
     * 中台REST服务基路径（外网/广域网）
     * 
     * @return
     */
    public static String getAPIRestUrlBaseWan() {
        return ConfigUtil.get("hsbcps.api.rest.urlBase.wan");
    }
    
    /**
     * 获取ID序列号尝试获得次数（由于并发而失败）
     * 
     * @return
     */
    public static int getIdSeqGenTries() {
        return ConfigUtil.get("func.idseq.gen.tries", ID_SEQ_GEN_TRIES);
    }
    
    /**
     * 获取使用超级验证码开关
     * 
     * @return
     */
    public static boolean getVerifyCodeSuperSwitch() {
        return ConfigUtil.get("func.verifycode.super.swich", false);
    }
    
    /**
     * 获取超级验证码
     * 
     * @return
     */
    public static String getVerifyCodeSuperValue() {
        return ConfigUtil.get("func.verifycode.super.value");
    }
    
    /**
     * 获取缓存实现类型
     * 
     * @return
     */
    public static String getCacheImplType() {
        return ConfigUtil.get("cache.implType");
    }
    
    /**
     * itn.lock.flag 默认为1
     * 
     * @return
     */
    public static int getLockFlag() {
        return ConfigUtil.get("itn.lock.flag", 1);
    }
    
    /**
     * itn.businsys.no 默认为1002
     * 
     * @return
     */
    public static long getBusinsysNo() {
        return ConfigUtil.get("itn.businsys.no", 1002);
    }
    
    /**
     * itn配置信息获取
     * 
     * @return
     */
    public static boolean getItnregistrTokenSwich() {
        return ConfigUtil.get("itn.register.token.swich", false);
    }
    
    /**
     * 活动规则配置信息获取
     * 
     * @return
     */
    public static boolean getActivityRule() {
        return ConfigUtil.get("activity.qx.team.rule", false);
    }

    public static String getActivityUrl() {return ConfigUtil.get("activity.chest.url","");}
    /**
     * 获取短信实现类型
     * 
     * @return
     */
    public static String getSMSImpl() {
        return ConfigUtil.get("sms.impl",SMS_IMPL);
    }

    
    public static String getStoreImplType() {
        return ConfigUtil.get("store.implType");
    }
    
    public static String getStoreFilePath() {
        return ConfigUtil.get("store.file.path");
    }
    
    public static String getOSSInnerDomain() {
        return ConfigUtil.get("store.oss.innerDomain");
    }
    
    public static String getOSSAccessId() {
        return ConfigUtil.get("store.oss.accessKey");
    }
    
    public static String getOSSAccessKey() {
        return ConfigUtil.get("store.oss.accessSecret");
    }
    
    public static String getOSSBucketName() {
        return ConfigUtil.get("store.oss.bucketName");
    }
    
    public static String getOSSDebug() {
        return ConfigUtil.get("store.oss.debug");
    }
    
    public static String getInterfaceUagAddr() {
        return ConfigUtil.get("interface.uag.addr");
    }
    
    public static String getInterfaceOssAddr() {
        String address = ConfigUtil.get("interface.oss.addr");
        if (!address.endsWith("/")) {
            address += "/";
        }
        return address;
    }
    
    public static String getDownloadIgnoreCheckFilename() {
        return ConfigUtil.get("download.ignore.check.filename", "");
    }
    
    public static String getYunxinAppkey() {
        return ConfigUtil.get("yunxin.app_key", YUNXIN_APP_KEY);
    }
    
    public static String getYunxinAppSecret() {
        return ConfigUtil.get("yunxin.app_secret", YUNXIN_APP_SECRET);
    }
    
    public static String getYunxinNonce() {
        return ConfigUtil.get("yunxin.nonce", YUNXIN_NONCE);
    }
    
    public static String getSmsOwnCompanyId() {
        return ConfigUtil.get("sms.own.company.id",SMS_OWN_COMPANY_ID);
    }
    
    public static String getSmsCompanyId() {
        return ConfigUtil.get("sms.company.id",SMS_COMPANY_ID);
    }
    
    public static String getSmsBusinsysNo() {
        return ConfigUtil.get("sms.businsys.no",SMS_BUSINSYS_NO);
    }
    
    public static String getSmsAuthKey() {
        return ConfigUtil.get("sms.authkey",SMS_AUTHKEY_TEXT);
    }
    
    public static String getMailImpl() {
        return ConfigUtil.get("mail.impl");
    }
    
    public static String getSMSSvcUrl() {
        return ConfigUtil.get("sms.svc.url",SMS_SVC_URL);
    }
    
    public static String getMailSvcUrl() {
        return ConfigUtil.get("mail.svc.url");
    }
    
    public static int getSmsSendCountDown() {
        return ConfigUtil.get("func.verifycode.send.count.down", 90);
    }
    
    public static String getRegCheckAccount() {
        return ConfigUtil.get("func_reg_check_account", "account");
    }
    
    public static String getRegCheckPassword() {
        return ConfigUtil.get("func_reg_check_password", "password");
    }
    
    /**
     * 超时时间内验证次数
     *
     * @return
     */
    public static int getVerifyCodeTimesInOutTime() {
        return ConfigUtil.get("func.verifycode.time", VERIFY_CODE_RETRY_TIMES);
    }
    
    /**
     * 验证码超时时间（秒）
     * @return
     */
    public static int getMobileVerifyCodeTimeout() {
        return ConfigUtil.get("func_mobile_verifycode_time_out", VERIFY_CODE_TIMEOUT);
    }
    
    /**
     * 每页请求行数
     * @return
     */
    public static int getRequestNum() {
        return ConfigUtil.get("func_request_num", REQUEST_NUM);
    }
    
    /**
     * 付费观点默认显示字数
     * @return
     */
    public static int getPayReadViewpointShow() {
        return ConfigUtil.get("func_payread_viewpoint_show", PAYREAD_VIEWPOINT_SHOW);
    }
    
    public static String[] getDefaultViewpointTag() {
        String tagstr = ConfigUtil.get("func_default_viewpoint_tag");
        if (StringUtil.isEmpty(tagstr)) {
            return DEFAULT_VIEWPOINT_TAG;
        }
        return tagstr.split(",");
    }
    
    public static int getDefineTagNum() {
        return ConfigUtil.get("func_define_tag_num", DEFINE_TAG_NUM);
    }
    
    /**
     * 粉丝端链接地址配置
     * @return
     */
    public static String getFansWebUrlDomain() {
        return ConfigUtil.get("func_fans_web_domain", "http://127.0.0.1:21600/");
    }
    
    /**
     * 验证码超时时间（秒）
     * @return
     */
    public static int getImgVerifyCodeTimeout() {
        return ConfigUtil.get("func.img.verifycode.timeout", VERIFY_CODE_TIMEOUT);
    }
    
    public static String getNotifyUrl() {
        return ConfigUtil.get("wx.notify.url", NOTIFY_URL);
    }
    
    public static String getWeixinAppKey() {
        return ConfigUtil.get("wx.app.key", WEIXIN_APP_KEY);
    }

    public static String getWeixinMassAppKey() {
        return ConfigUtil.get("wx.mass.app.key", WEIXIN_APP_KEY);
    }

    public static String getWeixinMassAppSecret() {
        return ConfigUtil.get("wx.mass.app.secret", WEIXIN_APP_SECRET);
    }
    
    public static String getWxAppKeyByTenant(Integer tenantId) {
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + tenantId);
        if (tenantConfig == null) {
            return null;
        }
        return tenantConfig.get("wx.app.key", "");
    }
    
    public static String getWxAppSecretByTenant(Integer tenantId) {
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + tenantId);
        if (tenantConfig == null) {
            return null;
        }
        return tenantConfig.get("wx.app.secret", "");
    }
    
    public static String getWeixinAppSecret() {
        return ConfigUtil.get("wx.app.secret", WEIXIN_APP_SECRET);
    }
    
    public static String getMchId() {
        return ConfigUtil.get("weixin.mch_id", MCH_ID);
    }
    
    public static String getTongLianId() {
        return ConfigUtil.get("tonglian.id");
    }
    
    public static String getTongLianKey() {
        return getTongLianKey(null);
    }
    
    public static String getTongLianKey(Long brokerId) {
        if (brokerId != null) {
            DataContext.setBrokerId(String.valueOf(brokerId));
        }
        return ConfigUtil.get("tonglian.key");
    }
    
    public static String getTongLianCID() {
        return ConfigUtil.get("tonglian.cusid");
    }
    
    public static boolean getMycatFlag() {
        return ConfigUtil.get("func_mycat_flag", false);
    }
    
    public static Integer getMycatNum() {
        return ConfigUtil.get("func_mycat_num", 4);
    }
    
    public static boolean getMybatisCacheFlag() {
        return ConfigUtil.get("func_mybatis_cache_flag", false);
    }



    public static class ClientMessage {
        
        public static String getSendRegisterVerifyCodeMessage(Object... vars) {
            return ConfigUtil.getWithFormat("clientmsg.verifyCode.register", vars);
        }
        
        public static String getSendSetPwdVerifyCodeMessage(Object... vars) {
            return ConfigUtil.getWithFormat("clientmsg.verifyCode.set.pwd", vars);
        }
        
        public static String getSendUpdateMobileVerifyCodeMessage(Object... vars) {
            return ConfigUtil.getWithFormat("clientmsg.verifyCode.update.mobile", vars);
        }
        
        public static String getSendTransactionVerifyCodeMessage(Object... vars) {
            return ConfigUtil.getWithFormat("clientmsg.verifyCode.transaction", vars);
        }
        
        public static String getSendPrizeSNVerifyCodeMessage(Object... vars) {
            return ConfigUtil.getWithFormat("clientmsg.verifyCode.prizeSN", vars);
        }
        
        public static String getSendInviteCodeVerifyCodeMessage(Object... vars) {
            return ConfigUtil.getWithFormat("clientmsg.verifyCode.inviteCode", vars);
        }
        
        public static String getSendExpressInfoVerifyCodeMessage(Object... vars) {
            return ConfigUtil.getWithFormat("clientmsg.verifyCode.expressInfo", vars);
        }
        
        public static String getSendLoginVerifyCodeMessage(Object... vars) {
            return ConfigUtil.getWithFormat("clientmsg.verifyCode.login", vars);
        }
    }
    
    public static String getWeiboAppKey() {
        return ConfigUtil.get("weibo_client_id", WEIBO_APP_KEY);
    }
    
    public static String getWeiboAppSecret() {
        return ConfigUtil.get("weibo_client_secret", WEIBO_APP_SECRET);
    }
    
    public static String getWeiboRedirectUri() {
        return ConfigUtil.get("weibo_redirect_uri", WEIBO_REDIRECT_URI);
    }
    
    public static String getQQAppKey() {
        return ConfigUtil.get("qq_client_id", QQ_APP_KEY);
    }
    
    public static String getQQAppSecret() {
        return ConfigUtil.get("qq_client_secret", QQ_APP_SECRET);
    }

    public static String getYunjiBranchNo() {
        return ConfigUtil.get("yunji_branch_no", YUNJI_BRANCH_NO);
    }

    public static String getUserCenterKey() {
        return ConfigUtil.get("user_center_key", USER_CENTER_KEY);
    }

    public static String getOpenApiAuthUrl() {
        return ConfigUtil.get("openapi.auth_url", OPEN_API_AUTH_UTL);
    }
    
    public static String getOpenApiAppKey() {
        return ConfigUtil.get("openapi.app_key", OPEN_API_APP_KEY);
    }
    
    public static String getOpenApiAppSecret() {
        return ConfigUtil.get("openapi.app_secret", OPEN_API_APP_SECRET);
    }
    
    public static String getOpenApiRedirectUri() {
        return ConfigUtil.get("openapi.redirect_uri", OPEN_API_REDIRECT_URI);
    }
    
    public static String getQQRedirectUri() {
        return ConfigUtil.get("qq_redirect_uri", QQ_REDIRECT_URI);
    }
    
    public static String getAvoidTag() {
        return ConfigUtil.get("xss.avoid.tag", QQ_REDIRECT_URI);
    }
    
    /**
     * 搜索引擎是否可用
     * 
     * @return
     */
    public static Boolean getSearchEngineEnable() {
        return ConfigUtil.get("searchEngine.enable", false);
    }
    
    public static Integer getCompressSize() {
        return ConfigUtil.get("img_comperss_size", COMPRESS_SIZE);
    }
    
    public static Double getCompressRatio() {
        return ConfigUtil.get("img_comperss_ratio", COMPRESS_RATIO);
    }
    
    public static boolean IsUserCenter(){
        return ConfigUtil.get("uc.flag", false);
    }
    
    public static String getGoldIntUrl(){
        return ConfigUtil.get("gold.int.url","http://127.0.0.1:23000");
    }
    
    public static String getGoldAnthKey(){
        return ConfigUtil.get("gold.auth.key","3b0c4f4d00134bf7895745cd10dba692");
    }
    
    public static String getGoldAnthSecret(){
        return ConfigUtil.get("gold.secret","26daeb29dad742da8dbc706e6fb6d665");
    }
    
    public static boolean getUf30Flag(){
        return ConfigUtil.get("uf30.flag", false);
    }

    public static String getUserBehaviorAppKey(Long tenantId) {
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig(ValueUtil.getString(tenantId));
        if (tenantConfig == null) {
            return null;
        }
        return tenantConfig.get("user.behavior.app.key", USER_BEHAVIOR_APP_KEY);
    }

    public static String getUserBehaviorAppKeyTenant(Integer tenantId) {
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + ValueUtil.getString(tenantId));
        if (tenantConfig == null) {
            return null;
        }
        return tenantConfig.get("user.behavior.app.key", USER_BEHAVIOR_APP_KEY);
    }

    public static String getMd5Key(Integer tenantId) {
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + ValueUtil.getString(tenantId));
        if (tenantConfig == null) {
            return null;
        }
        return tenantConfig.get("md5.key",MD5_KEY);
    }

    public static String getPointAppKey(Integer tenantId) {
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + ValueUtil.getString(tenantId));
        if (tenantConfig == null) {
            return null;
        }
        return tenantConfig.get("point.app.key",POINT_APP_KEY);
    }

    public static String getPointAppSecret(Integer tenantId) {
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + ValueUtil.getString(tenantId));
        if (tenantConfig == null) {
            return null;
        }
        return tenantConfig.get("point.app.secret",POINT_APP_SECRET);
    }

    public static String getPointUrl(Integer tenantId) {
        TenantConfig tenantConfig = ConfigUtil.getTenantConfig("tenant" + ValueUtil.getString(tenantId));
        if (tenantConfig == null) {
            return null;
        }
        return tenantConfig.get("point.url",POINT_URL);
    }
}
